package com.zjk.toolkit.whitelist;

import com.zjk.toolkit.whitelist.cofig.WhiteListProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

@EnableConfigurationProperties(WhiteListProperties.class)
public class WhiteListAutoConfiguration {

    private static final Logger log = LoggerFactory.getLogger(WhiteListAutoConfiguration.class);

    @Bean("whiteListConfig")
    @ConditionalOnMissingBean
    public String whiteListConfig(WhiteListProperties properties) {
        log.info("whiteListConfig:{}", properties.getUsers());
        return properties.getUsers();
    }

}
